

export default function getLastSelector (path) {
  let len = path.length,selector=''
  for (let i = len - 3; i >=0; i--){
    let {localName,className,id} = path[i]
    selector += localName + (!!className?`.${className}`:'') + (!!id ? `#${id}`:'') + ' '
  }
  return selector
}